package oop第一章作业;
import java.util.Scanner;

public class Account {
    Scanner input = new Scanner(System.in);
    public String admit;
    int balance;

    public void deposit() {
        System.out.println("请输入账号");
        this.admit = input.next();
        System.out.println("请输入存款余额");
        this.balance = input.nextInt();
        if (this.admit.equals("123456") && this.balance == 10000) {
            System.out.println("请输入你要存的款数");
            this.balance += input.nextInt();
        } else {
            System.out.println("你输入的账号或者存款余额错误！！！");
        }
    }
    public void draw() {

        System.out.println("请输入账号");
        this.admit = input.next();
        System.out.println("请输入存款余额");
        this.balance = input.nextInt();
        if (this.admit.equals("123456") && this.balance == 10000) {
            System.out.println("请输入你要取的款数");
            this.balance -= input.nextInt();
        } else {
            System.out.println("你输入的账号或者存款余额错误！！！");
        }
    }
    public void query() {
        System.out.println("请输入账号");
        this.admit = input.next();
        System.out.println("请输入存款余额");
        this.balance = input.nextInt();
        if (this.admit.equals("123456") && this.balance == 10000) {
            System.out.println(this.balance);
        } else {
            System.out.println("你输入的账号或者存款余额错误！！！");
        }
    }
}
